home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / progtool / assemblr / re_ass / source85 / geminit.pas next >
Encoding:
Pascal/Delphi Source File  |  1994-09-22  |  1.8 KB  |  76 lines

  1. { ------------------------------------------------------------ }
  2. { UNIT  GEMINIT                                                }
  3. { (c) 1992 Pure Software GmbH                                  }
  4. {                                                              }
  5. { the unit GemInit performs all init and exit stuff needed to  }
  6. { execute a gem program.                                       }
  7. { ------------------------------------------------------------ }
  8.  
  9. unit    GemInit;
  10.  
  11. interface
  12.  
  13. {$X+}
  14. uses    gem;
  15.  
  16. var
  17.     vdiHandle, aesHandle : Integer;
  18.     apID : Integer;
  19.     workIn : workin_ARRAY;
  20.     workOut : workout_ARRAY;
  21.     charWidth, charHeight : Integer;
  22.     boxWidth, boxHeight : Integer;
  23.  
  24.  
  25.     function    InitGem : Boolean;
  26.     procedure    ExitGem;
  27.  
  28.  
  29. implementation
  30.  
  31. { ------------------------------------------------------------ }
  32. { this procedure ends up a gem program.                        }
  33. { ------------------------------------------------------------ }
  34.  
  35. procedure    ExitGem;
  36. begin
  37.     v_clsvwk( vdiHandle );
  38.     appl_exit;
  39. end;
  40.  
  41.  
  42. { ------------------------------------------------------------ }
  43. { this function initalizes the gem. it returns true if it was  }
  44. { successful.                                                  }
  45. { ------------------------------------------------------------ }
  46.  
  47. function    InitGem : Boolean;
  48. var
  49.     i : Integer;
  50. begin
  51.     apID := appl_init;
  52.     if apID >= 0 then
  53.     begin
  54.         aesHandle := graf_handle( charWidth, charHeight, boxWidth, boxHeight );
  55.         workIn[0] := aesHandle;
  56.         for i := 1 to workin_max - 1 do
  57.             workIn[i] := 1;
  58.         workIn[10] := 2;
  59.  
  60.         v_opnvwk( workIn, vdiHandle, workOut );
  61.         if vdiHandle <= 0 then
  62.         begin
  63.             appl_exit;
  64.             InitGem := False;
  65.         end
  66.         else
  67.             InitGem := True;
  68.     end
  69.     else
  70.         InitGem := False;
  71. end;
  72.  
  73. end.
  74.  
  75. { ============================================================ }
  76.